<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,user-scalable=0"/>
    <meta content="yes" name="apple-Mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <!--Use for debugging must be removed under production -->
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    <!-->
    <title>拍书献爱心#宁波印象城・蔡康永的秘密书房展</title>
</head>

<body>
<div class="checkIn">
    <div class="hel_seal_position">
        <div class="cky_checkIn_img"></div>
        <div class="bottom_checkIn_helper">
            <div class="shift_checkIn_helper">
            <div class="img_checkIn_signIn">
                <div class="img_checkIn_seal">
                </div>
            </div>
            </div>

        <div class="css_rest_helper">
            <hr/>
            <div class="thank_checkIn_text">
                166件电影、年代海报、复古刊物、书籍</br>
                跨越1842年-2015年</br>
                穿过173年时光隧道</br>
                9月，即将呈现于宁波印象城</br>
                用指间触碰历史 用声音传递故事</br>
                透过全息影像</br>
                同蔡康永先生面对面</br>
                聆听康永不为人知的内心故事</br>
            </div>
            <hr/>
            <div class="position_button_helper">
                <button class="navigator_checkIn_button loveProgress"><span class="text_navigator_detail">爱心进度</span>

                    <div class="arrow_navigator_img"></div>
                </button>
                <button class="navigator_checkIn_button shareFriend"><span class="text_navigator_detail">分享好友</span>

                    <div class="arrow_navigator_img"></div>
                </button>
            </div>
        </div>
        </div>
            <div class="explain_checkIn_text"><span class="dot_explain_word">·</span><span class="css_explain_helper">本活动最终解释权归宁波印象城所有</span><span
                    class="dot_explain_word">·</span></div>
    </div>
</div>
<div class="share">
    <div class="dir_share_img">
    </div>
</div>
<div class="congrats">
    <div class="reach_congrats_img"></div>
    <div class="btn_congrats_img"></div>
</div>
</body>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    var getPar = function (par) {
        var regex = new RegExp('[?&]' + par + '=([^&]*)', 'i');
        var tmpStr = decodeURI(window.location.href);
        var result = tmpStr.match(regex);
        return result ? result[1] : result;
    }
    var _$ = document.querySelector.bind(document);
    window.onload = function () {
        setTimeout(function () {
            _$('.checkIn').classList.add('show');
        }, 500);
        if(getPar('reach')==1){
            _$('.congrats').classList.add('show');
        }
    }
    _$('.loveProgress').addEventListener('touchstart', function () {

    });
    _$('.shareFriend').addEventListener('touchstart', function () {
        _$('.share').classList.add('show');
    });
    _$('.share').addEventListener('touchstart', function () {
        if (_$('.share.show'))
            _$('.share').classList.remove('show');
    });
    _$('.loveProgress').addEventListener('touchend', function () {
        location.href = 'progress.html';
    });
    _$('.btn_congrats_img').addEventListener('touchend',function(){
        _$('.congrats').classList.remove('show');
    });
    (function () {
        var $head = document.querySelector('head');
        var link = document.createElement('link');
        link.rel = 'stylesheet';
        link.href = 'css/signIn/signIn.css?t=' + (+new Date());
        $head.appendChild(link);
        var xhr = new XMLHttpRequest();
        var url = window.location.href;
        var tl='http://query.viscovery.net.cn/preHeat/preHeat.html';
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4 && xhr.status == 200) {
                var config = JSON.parse(xhr.responseText);
                var sharedData = {
                    desc: '拍书献爱心#宁波印象城・蔡康永的秘密书房展',
                    link: tl,
                    imgUrl:'http://query.viscovery.net.cn/preHeat/res/img/cky.jpg'
                };
                wx.config({
                    /*debug:true,*/
                    appId: config["appId"],
                    timestamp: config["timestamp"],
                    nonceStr: config["nonceStr"],
                    signature: config["signature"],
                    jsApiList: [
                        'uploadImage', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'chooseImage'
                    ]
                });
                wx.ready(function(){
                    wx.onMenuShareAppMessage({
                        title: sharedData.title,
                        desc: sharedData.desc,
                        link: sharedData.link,
                        imgUrl: sharedData.imgUrl
                    });
                    wx.onMenuShareTimeline({
                        title: sharedData.title,
                        desc: sharedData.desc,
                        link: sharedData.link,
                        imgUrl: sharedData.imgUrl
                    });
                })

            }

        }
        xhr.open('get', '../wechat/wxconfig.php?' + url, true);
        xhr.send();
    })();


</script>
</html>